#ifndef _STRAWGUI_COMPONENT_ALIGN_H_
#define _STRAWGUI_COMPONENT_ALIGN_H_

#include "sSaveable.h"
#include "sConfig.h"
#include "sMath.h"

#ifdef _EDITOR
#include "sRTTIObject.h"
#endif

namespace sgui
{
namespace res
{    

class sComponentAlign: public sSaveable
#ifdef _EDITOR
, public rtti::sObject
#endif
{
public:
	typedef enum {
		EAP_TOP = 0,
		EAP_BOTTOM,
		EAP_LEFT,
		EAP_RIGHT,
		EAP_CENTER_HORISONTAL,
		EAP_CENTER_VERTICAL,

		EAP_COUNT
	} EAttachPoint;

private:
	bool					m_attachPoints[EAP_COUNT];
public:
    bool getAttachPoint(u32 idx) const { return m_attachPoints[idx]; }
	void setAttachPoint(u32 idx, bool value) { m_attachPoints[idx] = value; }

	sComponentAlign();

	void applyResize(math::sRectf& rect, math::sPointf sizeDifference) const;

	void save(db::Record& file) const;
	void load(const db::Record& file);
	void clear();
#ifdef _EDITOR
	void exportRTTI(rtti::sInfoList& list);
#endif
};

};
};

#endif